package com.bsfcs.rag.enums;

public enum ClientType {
    ENTERPRISE(1, "企业端"),
    GOVERNMENT(2, "政府端"),
    OTHER(3, "其他");

    private final int code;
    private final String name;

    ClientType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    // 根据 code 获取枚举实例
    public static ClientType fromCode(int code) {
        for (ClientType type : values()) {
            if (type.code == code) {
                return type;
            }
        }
        throw new IllegalArgumentException("未知的客户端类型 code: " + code);
    }

}
